home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / pascal / dlgdsn41.zip / TINPLONG.H < prev   
C/C++ Source or Header  |  1993-07-15  |  2KB  |  65 lines

  1. #if defined( Uses_TInputLong ) && !defined( __TInputLong )
  2. #define __TInputLong
  3.  
  4. //flags for TInputLong constructor
  5.  
  6. const
  7.   ilHex = 1,          //will enable hex input with leading '0x'
  8.   ilBlankEqZero = 2,  //No input (blank) will be interpreted as '0'
  9.   ilDisplayHex = 4;   //Number displayed as hex when possible
  10.  
  11. class far TRect;
  12. class far TEvent;
  13.  
  14. class TInputLong : public TInputLine
  15. {
  16.  
  17. public:
  18.  
  19.     TInputLong( const TRect& bounds, int aMaxLen, long lowerLim,
  20.             long upperLim, ushort flags, const char* labelName = 0 );
  21.     ~TInputLong();
  22.  
  23.     virtual ushort dataSize();
  24.     virtual void getData( void *rec );
  25.     virtual void handleEvent( TEvent& event );
  26.     virtual void setData( void *rec );
  27.     virtual Boolean rangeCheck();
  28.     virtual void error();
  29.     virtual Boolean valid(ushort command);
  30.  
  31.     ushort ilOptions;
  32.     long lLim, uLim;
  33.     char* label;
  34.  
  35. private:
  36.  
  37.     virtual const char *streamableName() const
  38.     { return name; }
  39.  
  40. protected:
  41.  
  42.     TInputLong( StreamableInit );
  43.     virtual void write( opstream& );
  44.     virtual void *read( ipstream& );
  45.  
  46. public:
  47.  
  48.     static const char * const near name;
  49.     static TStreamable *build();
  50.  
  51. };
  52.  
  53. inline ipstream& operator >> ( ipstream& is, TInputLong& cl )
  54.     { return is >> (TStreamable&)cl; }
  55. inline ipstream& operator >> ( ipstream& is, TInputLong*& cl )
  56.     { return is >> (void *&)cl; }
  57.  
  58. inline opstream& operator << ( opstream& os, TInputLong& cl )
  59.     { return os << (TStreamable&)cl; }
  60. inline opstream& operator << ( opstream& os, TInputLong* cl )
  61.     { return os << (TStreamable *)cl; }
  62.  
  63. #endif  // Uses_TInputLong
  64.  
  65.